#ifndef __AHUMQTT_H__
#define __AHUMQTT_H__

#include <mosquitto.h>

#include <stdbool.h>
#include <string.h>

#define ES_MQTT_HOST		"localhost"
//#define ES_MQTT_HOST		"192.168.37.232"
//#define ES_MQTT_HOST		"172.16.100.59"
#define ES_MQTT_PORT		(1883)
#define ES_MQTT_KEEPALIVE	(60)

/* cmd = addDeivce 报文会发到这个主题，直接订阅这个主题 */
#define MQTT_SUB_INIT_CMD       "local/gateway/gateway/command"

#define MQTT_LOCAL_PREFIX         "local/gateway"

void ahu_mqtt_msg_cb(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *msg);
void ahu_mqtt_log_cb(struct mosquitto *mosq, void *userdata, int level, const char *str);
void ahu_mqtt_conn_cb(struct mosquitto *mosq, void *userdata, int rc);
void ahu_mqtt_sub_cb(struct mosquitto *mosq, void *userdata, int mid, int qos_count, const int *granted_qos);
void ahu_mqtt_pub_cb(struct mosquitto *mosq, void *userdata, int mid);

#endif // __AHUMQTT_H__